import { Component, NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { SalesMasterComponent } from './sales-master.component';
import { SalesQuotationOrderComponent } from './sales-quotation-order/sales-quotation-order.component';
import { AddSalesQuotationOrderComponent } from './sales-quotation-order/add-sales-quotation-order/add-sales-quotation-order.component';
import { EditSalesQuotationOrderComponent } from './sales-quotation-order/edit-sales-quotation-order/edit-sales-quotation-order.component';
import { DetailSalesQuotationOrderComponent } from './sales-quotation-order/detail-sales-quotation-order/detail-sales-quotation-order.component';
import { SalesOrderComponent } from './sales-order/sales-order.component';
import { AddSalesOrderComponent } from './sales-order/add-sales-order/add-sales-order.component';
import { EditSalesOrderComponent } from './sales-order/edit-sales-order/edit-sales-order.component';
import { SalesInvoiceComponent } from './sales-invoice/sales-invoice.component';
import { SalesInvoiceAddComponent } from './sales-invoice/sales-invoice-add/sales-invoice-add.component';
import { SalesInvoiceEditComponent } from './sales-invoice/sales-invoice-edit/sales-invoice-edit.component';
import { SalesReturnComponent } from './sales-return/sales-return.component';
import { SalesReturnAddComponent } from './sales-return/sales-return-add/sales-return-add.component';
import { SalesReturnEditComponent } from './sales-return/sales-return-edit/sales-return-edit.component';
import { SalesWorkbenchComponent } from './sales-workbench/sales-workbench.component';
import { CanActivateGuard } from 'src/app/@core/services/can-load-service.guard';
import { SalesPaymentComponent } from './sales-payment/sales-payment.component';
import { AddSalesPaymentComponent } from './sales-payment/add-sales-payment/add-sales-payment.component';
import { SalesLedgerComponent } from './sales-ledger/sales-ledger.component';
import { AfterSalesCenterComponentComponent } from './after-sales-center-component/after-sales-center-component.component';

const routes: Routes = [
  {
    path: '',
    component: SalesMasterComponent,
    children: [
      {
        path: 'sales-quotation-order',
        component: SalesQuotationOrderComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path: 'sales-quotation-order/add',
        component:AddSalesQuotationOrderComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path: 'sales-quotation-order/edit/:id',
        component:EditSalesQuotationOrderComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path: 'sales-quotation-order/detail/:id',
        component:DetailSalesQuotationOrderComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path: 'sales-order',
        component: SalesOrderComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path: 'sales-order/add',
        component: AddSalesOrderComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path: 'sales-order/edit/:id',
        component: EditSalesOrderComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path: 'sales-order/detail/:id',
        component: SalesOrderComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:"sales-Invoice",
        component:SalesInvoiceComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:"sales-Invoice/add",
        component:SalesInvoiceAddComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:"sales-Invoice/edit/:id",
        component:SalesInvoiceEditComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'sales-return-order',
        component:SalesReturnComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'sales-return-order/add',
        component:SalesReturnAddComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'sales-return-order/edit/:id',
        component:SalesReturnEditComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path: 'sales-workbench',
        component: SalesWorkbenchComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path: 'sales-payment',
        component: SalesPaymentComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path: 'sales-ledger',
        component: SalesLedgerComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path: 'add-sales-payment',
        component: AddSalesPaymentComponent,
        canActivate: [CanActivateGuard]
      },
       {
        path: 'after-sales-center',
        component: AfterSalesCenterComponentComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path: '',
        redirectTo: 'sales-workbench',
        pathMatch: 'full'

      }
    ]
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class SalesMasterRoutingModule { }
